package logic.regulardevices;

public class Stove  extends RegularDevice {

	private boolean on;
	
	public Stove() {
		id="st";
	}

	@Override
	public String receiveAndRespond(String cmd) {
		if(cmd.equals("on")) {
			on=true;
			return "on";
		} else if(cmd.equals("off")) {
			on=false;
			return "off";
		} else if(cmd.equals("check")) { //checks the firealarms state.
			return check();
		}
		return invalidCommand();
	}

	@Override
	public String check() {
		if(on) return "on";
		return "off";
	}

	@Override
	public String test() {
		// TODO Auto-generated method stub
		return null;
	}
}
